﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LearnDrive
{
    public partial class frmWMpwd : Form
    {
        private int kemu = 1;
        public frmWMpwd(int i)
        {
            InitializeComponent();
            kemu = i;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string pwd=textBox1.Text.Trim();
            string key = "AutoSend";
            string iv = "weiwei@1";
            WebReference2.Heart hwm = new WebReference2.Heart();
            string serverpwd = hwm.GetWenMangPass(kemu);
            serverpwd = Tools.Decode(serverpwd, key, iv);
            if (pwd == serverpwd)
            {
                this.DialogResult = DialogResult.Yes;
                this.Close();
            }
            else
            {
                MessageBox.Show("密码不对！");
                this.DialogResult = DialogResult.No;
                this.Close();
            }
        }

        private void frmWMpwd_Load(object sender, EventArgs e)
        {
            this.textBox1.Focus();
        }
    }
}
